﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using ObviousCode.Aspect.PluginLibrary.Interfaces;
using ObviousCode.Aspect.PluginLibrary;
using ObviousCode.Common.Utils;
using ObviousCode.Common.Utils.Library.Dictionaries;

namespace ObviousCode.UI.Aspect.PluginLibrary.Interfaces
{
    public interface ISurfaceObject : ISelfRenderingChartObject
    {               
        void SetUp();
        void TearDown();
        string Description { get; }
        string Key { get; }

        //Handled by base object
        bool SupportsEvent(string eventKey);
        
        bool HandlesDrag { get; }
        bool HandlesHover { get; }
        bool HandlesSelect { get; }
        bool IsDragging { get; }
        bool IsInAffinativeDrag { get; }
        bool Selected { get; set; }

        object HandleEvent(string eventKey, params object[] args);

        event EventHandler RefreshRequested;
        event EventHandler SelectionStateChanged;
        event EventHandler StateChanged;
        event EventHandler DragStarted;
        event EventHandler<EventArgs<PointF>> Dragging;
        event EventHandler DragCompleted;
        event EventHandler TagChanged;

        string State { get; }
        string InstanceKey { get; }

        PropertyDictionary Properties { get; }

        PointF Position { get; }
        RectangleF GetLastRenderedBounds(Graphics graphics);
        IAspectItem Tag { get; set; }        
        ChartObjectImages Images { get; set; }
        IUITheme Theme { get; set; }
        
        RectangleF Render(Graphics graphics);

        void SetPosition(PointF point);

        void BeginAffinativeDrag();

        void ContinueAffinativeDrag(PointF pointF);

        void EndAffinativeDrag();

        PropertyDictionary Persist();

        void Load(PropertyDictionary dictionary, IAspectItem item);
    }
}
